        function setCookie(name, value) {
            var Days = 30;
            var exp = new Date();
            exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
            document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
        }

        function getCookie(name) {
            var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
            if (arr = document.cookie.match(reg)) return unescape(arr[2]);
            else return null;
        }

        function delCookie(name) {
            var exp = new Date();
            exp.setTime(exp.getTime() - 1);
            var cval = getCookie(name);
            if (cval != null) document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString();
        }

        function getArgs() {
            var args = {};
            var match = null;
            var search = decodeURIComponent(location.search.substring(1));
            var reg = /(?:([^&]+)=([^&]+))/g;
            while ((match = reg.exec(search)) !== null) {
                args[match[1]] = match[2];
            }
            return args;
        }


        var CookieUtil = {
            get: function(name) {
                var cookieName = encodeURIComponent(name) + "=",
                    cookieStart = document.cookie.indexOf(cookieName),
                    cookieValue = null;
                if (cookieStart > -1) {
                    var cookieEnd = document.cookie.indexOf(";", cookieStart)
                    if (cookieEnd == -1) {
                        cookieEnd = document.cookie.length;
                    }
                    cookieValue = decodeURIComponent(document.cookie.substring(cookieStart + cookieName.length, cookieEnd));
                }
                return cookieValue;
            },
            set: function(name, value, expires, path, domain, secure) {
                var cookieText = encodeURIComponent(name) + "=" + encodeURIComponent(value);
                if (expires instanceof Date) {
                    cookieText += ";expires=" + expires.toGMTString();
                }
                if (path) {
                    cookieText += ";path=" + path;
                }
                if (domain) {
                    cookieText += ";domain=" + domain;
                }
                if (secure) {
                    cookieText += ";secure";
                }
                document.cookie = cookieText;
            },
            unset: function(name, path, domain, secure) {
                this.set(name, "", new Date(0), path, domain, secure);
            }
        };

        function changelanguage() {
            var pagelanguage = getCookie("pagelanguage");
            if (pagelanguage == "zh-CN") {
                pagelanguage = "en"
                // setCookie("pagelanguage", pagelanguage);
                setllanguage(pagelanguage);
                changelanguage11(pagelanguage);
            } else {

                pagelanguage = "zh-CN"
                // setCookie("pagelanguage", pagelanguage);
                setllanguage(pagelanguage);
                changelanguage11(pagelanguage);
            }
        };

        function setlanguage() {
            var pagelanguage = getCookie("pagelanguage");
            if (pagelanguage == "zh-CN") {
                pagelanguage = "en"
                setCookie("pagelanguage", pagelanguage);
            } else {
                pagelanguage = "zh-CN"
                setCookie("pagelanguage", pagelanguage);
            }
        };

        function chagelinkhref(pagelanguage) {

            if ($("ul#nav-list>li>a")) {
                $("ul#nav-list>li>a").each(function(index, obj) {
                    var href = obj.href.split('?')[0]
                    obj.href = href + "?lan=" + pagelanguage;

                })
            }
            if ($("div>iframe")) {
                $("div>iframe").each(function(index, obj) {
                    var temp = getArgs($(obj).attr('src'));
                    var href = $(obj).attr('src').split('?')[0]
                    $(obj).attr('src', href + "?lan=" + pagelanguage);
                })
            }
        }


        function initpage(pagelanguage) {
            $(document).ready(function() {
                // setCookie("pagelanguage", pagelanguage)
                changelanguage11(pagelanguage);
                setllanguage(pagelanguage)

                if ($("ul#nav-list>li>a")) {
                    $("ul#nav-list>li>a").each(function(index, obj) {
                        var href = obj.href.split('?')[0]
                        obj.href = href + "?lan=" + pagelanguage;
                    })
                }
                if ($("div>div>a")) {
                    $("div>div>a").each(function(index, obj) {
                        var href = obj.href.split('?')[0]
                        obj.href = href + "?lan=" + pagelanguage;
                    })
                }
            })

        };
        /******************************************************/
